Next | Prev | Up | Top | Contents | Index

Entry Point mmap()

The pfxmmap() (note: two letters "m") entry can be used only in a character device driver. The prototype is

int pfxmmap(dev_t dev, off_t off, int prot);

The argument values are

dev A dev_t value from which you can extract both the major and minor device numbers.
offThe offset argument passed to mmap() by the user process.
prot Flags showing the access intentions of the user process.

The function is expected to return the page frame number (PFN) that corresponds to the offset off in the device address space. A PFN is an address divided by the page size. (See "Working With Page and Sector Units" for page unit conversion functions.)

This entry point is supported only for compatibility with SVR4. When the kernel needs to map a character device, it looks first for pfxmap(). It calls pfxmmap() only when pfxmap() is not available. The differences between the two entry points are as follows:


Next | Prev | Up | Top | Contents | Index